import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },

                
                {
                    path: '/machineList',
                    component: resolve => require(['../components/page/MachineList.vue'], resolve),
                    meta: { title: '售卖机报表' }
                },
                {
                    path: '/vendingMachineProducts',
                    component: resolve => require(['../components/page/vendingMachineProducts.vue'], resolve),
                    meta: { title: '账户商品库' }
                },
                {
                    path: '/replenishmentLog',
                    component: resolve => require(['../components/page/replenishmentLog.vue'], resolve),
                    meta: { title: '货道商品变更查询' }
                },
                {
                    path: '/vendingMachineProductLog',
                    component: resolve => require(['../components/page/VendingMachineProductLog.vue'], resolve),
                    meta: { title: '账户商品库变更查询' }
                },
                {
                    // 富文本编辑器组件
                    path: '/vendingMachineError',
                    component: resolve => require(['../components/page/vendingMachineError.vue'], resolve),
                    meta: { title: '售货机错误日志' }
                },
                {
                    // markdown组件
                    path: '/machinesTempLog',
                    component: resolve => require(['../components/page/machinesTempLog.vue'], resolve),
                    meta: { title: ' 售卖机温度信号曲线图' }    
                },
                {
                    // markdown组件
                    path: '/machinesChangeLog',
                    component: resolve => require(['../components/page/machinesChangeLog.vue'], resolve),
                    meta: { title: ' 售货机基本配置和灯温控日志' }    
                },
                {
                    // 图片上传组件
                    path: '/vendingMachineMsg',
                    component: resolve => require(['../components/page/vendingMachineMsg.vue'], resolve),
                    meta: { title: '售货机错误日志' }   
                },
                {
                    // vue-schart组件
                    path: '/locationMap',
                    component: resolve => require(['../components/page/locationMap.vue'], resolve),
                    meta: { title: '售货机线路图' }
                },
    
                {
                    path: '/replenishSuggest',
                    component: resolve => require(['../components/page/replenishSuggest.vue'], resolve),
                    meta: { title: '补货管理', permission: true }
                },
          
     
   
                {
                    path: '/rateShortsList',
                    component: resolve => require(['../components/page/rateShortsList.vue'], resolve),
                    meta: { title: '缺货报表', permission: true }
                },
                {
                    path: '/advertisingManagement',
                    component: resolve => require(['../components/page/advertisingManagement.vue'], resolve),
                    meta: { title: '广告管理', permission: true }
                },
                {
                    path: '/advertisingState',
                    component: resolve => require(['../components/page/advertisingState.vue'], resolve),
                    meta: { title: '广告状态', permission: true }
                },
                {
                    path: '/vendingMachinePositionRecord',
                    component: resolve => require(['../components/page/vendingMachinePositionRecord.vue'], resolve),
                    meta: { title: '售卖机GPS位置记录', permission: true }
                },
                {
                    path: '/waitCheckItem',
                    component: resolve => require(['../components/page/waitCheckItem.vue'], resolve),
                    meta: { title: '待审核商品管理', permission: true }
                },
                {
                    path: '/machineErrorType',
                    component: resolve => require(['../components/page/machineErrorType.vue'], resolve),
                    meta: { title: '售货机错误类型柱状图', permission: true }
                },
                {
                    path: '/salesRecord',
                    component: resolve => require(['../components/page/salesRecord.vue'], resolve),
                    meta: { title: '销售记录', permission: true }
                },
                {
                    path: '/statisticsPayPerDay',
                    component: resolve => require(['../components/page/statisticsPayPerDay.vue'], resolve),
                    meta: { title: '销售日报', permission: true }
                },
 
                {
                    path: '/statisticsPayPerItem',
                    component: resolve => require(['../components/page/statisticsPayPerItem.vue'], resolve),
                    meta: { title: '商品销售统计', permission: true }
                },
 
                {
                    path: '/vmReport',
                    component: resolve => require(['../components/page/vmReport.vue'], resolve),
                    meta: { title: '售货机报表', permission: true }
                },
 
                {
                    path: '/itemReport',
                    component: resolve => require(['../components/page/itemReport.vue'], resolve),
                    meta: { title: '商品报表', permission: true }
                },
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '/404',
            component: resolve => require(['../components/page/404.vue'], resolve)
        },
        {
            path: '/403',
            component: resolve => require(['../components/page/403.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
